
<?php
session_start();
require_once '../dao/membersdao.php';
require_once '../dto/memberdto.php';
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
    $UserName = $_REQUEST["tbusername_signup"];
    $Password = $_REQUEST["tbpassword_signup"];
    $Email = $_REQUEST["tbemail_signup"];
    $Location = $_REQUEST['tblocation_signup'];
    $Age = $_REQUEST['tbage_signup'];
    $Status = $_REQUEST['tbstatus_signup'];
    $Gender = $_REQUEST['tbgender_signup'];
    $member = new memberdto();
//    $member->_construct($UserName, $Password, $Email);
//    $member->setLocation($Location);
//    $member->setAge($Age);
//    $member->setStatus($Status);
    if($Gender)
        $Gender=TRUE;
    else {
        $Gender=FALSE;
    }
    $member->_contruct($UserName, $Password, $Email, $Age, $Location, $Gender, $Status);
    echo $member->getAge();
    echo $member->getEmail();
    echo $member->getGender();
    echo $member->getLocation();
    echo $member->getPassword();
    echo $member->getStatus();
    echo $member->getUserID();
    $res = membersdao::InsertMember($member);
//    echo $res;
    if($res){
         $_SESSION["member"]=$res;
        header("location:../web/index.php");
    }
    else {
        header("location:../page/signup.php");
    }
?>
